<template>
  <div class="box">

    <div class="userdata">

      <v-alchemyNav></v-alchemyNav>
      <div class="rightbox">
        <div class="rightbox-top">
          <ul>
            <li>
              <p>{{userInfo?userInfo.qingDan:0}}</p>
              <p>青丹</p>
            </li>
            <li>
              <p>{{userInfo?userInfo.yinDan:0}}</p>
              <p>银丹</p>
            </li>
            <li>
              <p>{{userInfo?userInfo.xianDan:0}}</p>
              <p>仙丹</p>
            </li>
            <li>
              <p>{{userInfo?userInfo.jinDan:0}}</p>
              <p>金丹</p>
            </li>
          </ul>
          <div>
            <p>总价值: </p>
            <p>{{listmost || 0}}{{gametype}}</p>
            <p @click='$router.push({path:"/assetes"})'>一键卖出</p>
          </div>
        </div>
        <div class="salesRecord">
          <div data-title="售出记录" class="sr-title">售出记录</div>
          <div>
            <div class="list-head">
              <span data-title="编号" class="lh-title1">编号</span>
              <span data-title="青丹" class="lh-title2">青丹</span>
              <span data-title="银丹" class="lh-title3">银丹</span>
              <span data-title="仙丹" class="lh-title4">仙丹</span>
              <span data-title="金丹" class="lh-title5">金丹</span>
              <span data-title="金丹" class="lh-title5">审核</span>
              <span data-title="售出时间" class="lh-title6">售出时间</span>
            </div>
          </div>
          <ul v-if='list.length>0'>
            <li v-for='(item,index) in list' :key='index'>
              <span data-title="1" class="lh-title1">{{index+1}}</span>
              <span data-title="37株" class="lh-title2">{{item.qingdan}}株</span>
              <span data-title="30株" class="lh-title3">{{item.yindan}}株</span>
              <span data-title="3000BPX" class="lh-title4">{{item.xiandan}}株</span>
              <span data-title="2018-07-14 16:00" class="lh-title5">{{item.jindan}}株</span>
              <span data-title="2018-07-14 16:00" class="lh-title5">{{item.isPass?'审核通过':'未审核'}}</span>
              <span data-title="2018-07-14 16:00" class="lh-title6">{{item.operatingDate}}</span>
            </li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import alchemyNav from "../alchemy_nav.vue";
export default {
  name: "assetss",
  data() {
    return {
      userInfo: u.getStore("userInfo"),
      list: "",
      gametype: u.getStore("winning").type
    };
  },
  components: {
    "v-alchemyNav": alchemyNav
  },
  computed: {
    listmost() {
      return (
        this.userInfo.qingDan * u.getStore("winning").qingdan +
        this.userInfo.yinDan * u.getStore("winning").yindan +
        this.userInfo.xianDan * u.getStore("winning").xiandan +
        this.userInfo.jinDan * u.getStore("winning").jindan
      );
    }
  },

  created() {
    let timer = setInterval(() => {
      if (u.flag) {
        this.userInfo = u.getStore("userInfo");
        u.sellList({ phone: u.getStore("user").userid }, data => {
          console.log(data);
          if (data && data[0] && data[0].rechargeSellList) {
            this.list = data[0].rechargeSellList;
          }
        });
        clearInterval(timer);
      }
    }, 10);
  },
  mounted() {
    this.$parent.flag1 = false;
    this.$parent.flag2 = true;
  }
};
</script>

<style lang="less" scoped>
//  @import '../css/base.css';

.box {
  padding: 20px 0;
  width: 100%;
  min-width: 1200px;
  min-height: 968px;
  background-image: url("../../../static/image/danbg2.png");
  background-size: 100% 100%;
}
.userdata {
  margin: 0 auto;
  max-width: 1290px;
  display: flex;
  justify-content: space-between;
  .leftbox {
  }
  .rightbox {
    width: 80%;
    .rightbox-top {
      width: 100%;
      height: 287px;
      background: url(../../../static/image/assetsbg1.png) no-repeat;
      background-size: 100% 100%;
      padding: 50px 0 0 22px;

      ul {
        display: flex;
        li {
          text-align: center;
          width: 82px;
          height: 93px;
          background: url(../../../static/image/z_10.png) no-repeat;
          padding-top: 20px;
          margin-right: 67px;
          > p:nth-of-type(1) {
            padding-top: 10px;
            // height: 50px;
            // line-height: 50px;
            color: white;
            font-size: 18px;
          }
          img {
            vertical-align: middle;
          }
          p {
            color: #ffd327;
            font-size: 14px;
            text-shadow: -2px 2px 1px #000;
          }
        }
      }
      div {
        display: flex;
        font-size: 18px;
        color: #ffffff;
        margin-top: 35px;
        line-height: 43px;
        & > p:first-of-type {
          text-shadow: -2px 2px 1px #000;
          margin-right: 18px;
        }

        & > p:last-of-type {
          text-align: center;
          line-height: 36px;
          font-size: 14px;
          width: 146px;
          height: 43px;
          background: url(../../../static/image/z_1.png) no-repeat;
          cursor: pointer;
        }
        & > p:nth-child(2) {
          font-size: 26px;
          text-shadow: 2px 3px 0px #dfb779;
          margin-right: 39px;
        }
      }
    }
    .rightbox-b {
      height: 653px;
      background: url(../../../static/image/assetsbg2.png) no-repeat;
      margin-top: 20px;
      padding: 23px 0 0 22px;
      .out {
        margin: 0 auto;
        width: 300px;
        height: 76px;

        background: url(../../../static/image/z_3.png) no-repeat;
        p {
          text-align: center;
          line-height: 48px;
          font-size: 20px;
          letter-spacing: 1px;
          color: #ffffff;
          text-shadow: 1px 1px 1px #1c6b65;
        }
      }
      ul {
        li {
          height: 69px;
          display: flex;
          align-items: center;
          justify-content: space-around;
          background: url(../../../static/image/z_5.png) no-repeat;
        }
      }
    }
  }
}
.salesRecord {
  margin-top: 18px;
  padding: 20px 26px;
  width: 100%;
  height: 653px;
  background-image: url(../../../static/image/assetsbg2.png);
  background-size: 100% 100%;
  .sr-title {
    margin: 0 auto;
    width: 300px;
    height: 76px;
    font-weight: bold;
    font-size: 20px;
    color: #fff;
    text-align: center;
    line-height: 47px;
    background-image: url(../../../static/image/z_3.png);
    background-size: 100% 100%;
    position: relative;
    z-index: 0;
  }
  .list-head {
    display: flex;
    justify-content: space-around;
    margin-top: 40px;
    margin-bottom: 15px;
    width: 98%;
    height: 70px;
    line-height: 70px;
    font-size: 20px;
    font-weight: bold;
    color: #fff;
    background-image: url(../../../static/image/z_4.png);
    background-size: 100% 100%;

    span {
      display: inline-block;
      text-align: center;
    }
  }
  ul {
    max-height: 390px;
    overflow: auto;
    li {
      display: flex;
      justify-content: space-around;
      width: 99%;
      height: 65px;
      line-height: 65px;
      font-size: 20px;
      color: #fff;
      background-image: url(../../../static/image/z_5.png);
      background-size: 100% 100%;

      span {
        display: inline-block;
        text-align: center;
      }
    }
  }
  ul::-webkit-scrollbar {
    width: 10px;
  }
  ul::-webkit-scrollbar-track-piece {
    background-color: #ebcf8f;
    -webkit-border-radius: 5px;
  }
  ul::-webkit-scrollbar-thumb:vertical {
    background-color: #b6e866;
    -webkit-border-radius: 5px;
  }
  .lh-title1 {
    width: 5%;
  }
  .lh-title2 {
    width: 7%;
  }
  .lh-title3 {
    width: 7%;
  }
  .lh-title4 {
    width: 7%;
  }
  .lh-title5 {
    width: 9%;
  }
  .lh-title6 {
    width: 22%;
  }
}
</style>
